<?php

class Default_Form_Login extends Zend_Form {

	public function init() {
		$login = $this->createElement('text', 'login');
		$login->setLabel(_('Логин или email:'));
		$login->setAttrib('size', '40');
		
		$password = $this->createElement('password', 'password');
		$password->setLabel(_('Пароль:'));
		$password->setAttrib('size', '40');
		
		$remember = $this->createElement('checkbox','remember');
		$remember->setLabel(_('Чужой компьютер:'));
		$remember->setDecorators(array(
				    'ViewHelper',
				    'Errors',
				    array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'element')),
				    array('Label', array('tag' => 'td'),
				    array(array('row' => 'HtmlTag'), array('tag' => 'tr')),
				)));
		
		$submit = $this->createElement('submit', 'submit');
		$submit->setLabel(_('Вход'));
		$submit->setDecorators(array(
			    'ViewHelper',
			    array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'element')),
			    array(array('label' => 'HtmlTag'), array('tag' => 'td', 'placement' => 'append')),
			    array(array('row' => 'HtmlTag'), array('tag' => 'tr')),
			));
			
		$this->setDecorators(array(
			    'FormElements',
			    array('HtmlTag', array('tag' => 'table')),
			    'Form',
			));
		
		$this->addElements(array($login, $password, $remember, $submit));
	}
}
